home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-06 | 1.2 KB | 60 lines | [TEXT/QED1] |
- /*
- Terminal 1.7
- "Log into CompuServe.s"
- */
-
- /* ----- Send command and wait for reply ------------------------------- */
-
- check(char *command, char *reply)
- {
- type(command);
- return prompt(reply, 1800); /* Timeout = 30 sec */
- }
-
- /* ----- Wait for prompt and send command ------------------------------ */
-
- answer(char *hint, char *command)
- {
- int result;
-
- if (result = prompt(hint, 1800))
- return result; /* Timeout or cancel */
- pause(60); /* Don't type immediatly */
- type(command);
- return 0;
- }
-
- /* ----- Main program -------------------------------------------------- */
-
- main()
- {
- int go = 1;
-
- while (go) {
- /* Special modem setup (for LUXPAC) */
- if (check("ATS7=60S10=14S9=12\r", "OK"))
- break;
- pause(60);
- /* Dial and log into LUXPAC */
- if (check("ATDP0735\r", "CONNECT"))
- break;
- if (answer("LUXPAC", "N...-03132\r"))
- break;
- /* Now log into CompuServe */
- if (answer("Name", "CIS\r"))
- break;
- if (answer("ID", "73720,2200\r"))
- break;
- if (answer("word", "...\r"))
- break;
- go = 0; /* Ok */
- }
- if (go) { /* Timeout or cancel */
- setdtr(0); /* Negate DTR: modem hangs up */
- pause(60); /* Wait one second */
- setdtr(1); /* Assert DTR: now back in command mode */
- beep(); /* 2 beeps if errror */
- }
- beep();
- }
-